<!DOCTYPE html>
<html>
<head>
<title>编辑内容</title>
#include("../include/common.html")
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>编辑内容</h5>
            </div>
           <form id="inputForm" action="update" method="post">
           		<input type="hidden" name="id" value="#(content.id)" />
           		<input type="hidden" name="categoryId" value="#(content.category.id)" />
	            <div class="ibox-content">
	                <div class="form-horizontal clearfix">
	                	<div class="form-group">
	                        <label class="col-sm-3 control-label">分类：</label>
	                        <div class="col-sm-3">
	                            #(content.category.name)
	                        </div>
	                    </div>
	                    <div class="form-group">
	                        <label class="col-sm-3 control-label">图片：</label>
	                        <div class="col-sm-3">
	                            <input type="text" name="image" class="form-control" value="#(content.image)"/>
	                        </div>
	                        <div class="col-sm-3">
								<a href="javascript:;" id="filePicker" class="btn btn-primary">选择文件</a>
	                        </div>
	                    </div>
	                    <div class="form-group">
                            <label class="col-sm-3 control-label">标题：</label>
                            <div class="col-sm-3">
                                 <textarea class="form-control" style="height: 50px;" name="title">#(content.title)</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">关键词：</label>
                            <div class="col-sm-3">
                                 <textarea class="form-control" style="height: 50px;" name="keywords">#(content.keywords)</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">描述：</label>
                            <div class="col-sm-3">
                                 <textarea class="form-control" style="height: 50px;" name="description">#(content.description)</textarea>
                            </div>
                        </div>
                        #if(content.category.model==2)
                        <div class="form-group">
                            <label class="col-sm-3 control-label">下载地址：</label>
                            <div class="col-sm-3">
                                 <textarea class="form-control" style="height: 50px;" name="downUrl">#(content.downUrl)</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">演示地址：</label>
                            <div class="col-sm-3">
                                <input class="form-control" type="text" name="demoUrl" value="#(content.demoUrl)">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">项目名称：</label>
                            <div class="col-sm-3">
                                <input class="form-control" type="text" name="project" value="#(content.project)">
                            </div>
                        </div>
                        #end
	                    <div class="form-group">
	                        <label class="col-sm-3 control-label">简介：</label>
	                        <div class="col-sm-8">
	                           <textarea id="introduction" name="introduction" class="ibox-content no-padding" style="height: 250px;">#(content.introduction)</textarea>
	                        </div>
	                    </div>
	                </div>
	            </div>
	            <div class="modal-footer col-sm-3 col-sm-offset-2">
	                <button type="submit" class="btn btn-w-m btn-primary">确定</button>
	                <button type="button" class="btn btn-w-m btn-default" onclick="history.back(); return false;">取消</button>
	            </div>
            </form>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	var $introduction = $("#introduction");
	var $filePicker = $("#filePicker");
	
	$filePicker.uploader();
	$introduction.editor();
	
 	// 表单验证
    $inputForm.validate({
        rules: {
            title: "required",
            categoryId: "required"
        }
    });

});
</script>
